<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script src="./react.js"></script>
</head>
<body>
  <div id="container"></div>
  <script>
    var HelloMessage = React.createClass({
      getInitialState: function() {
        return {type: 'say:'};
      },
      componentWillMount: function() {
        console.log('我就要开始渲染了。。。')
      },
      componentDidMount: function() {
        console.log('我已经渲染好了。。。')
      },
      render: function() {
        return React.createElement("div", null, this.state.type, "Hello ", this.props.name);
      }
    });

    React.render(React.createElement(HelloMessage, {name: "John"}), document.getElementById("container"));
    // function hello(){
    //     alert('hello')
    // }
    // var element = React.createElement('div',{id:'test',onclick: hello},'click me')
    // console.log(element);
    // React.render(element, document.getElementById("container"))

    // React.render('hello world', document.getElementById("container"))
  </script>
</body>
</html>